<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<c:if test="${empty list }">
	<c:redirect url="ListServlet"></c:redirect>
</c:if>
<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
<script type="text/javascript">
$(function(){
	$("th:first").css("backgroundColor","#6f6f6f");
	$("tr:odd").css("backgroundColor","#9f9f9f");
});
	function dele(id) {
		if (confirm("确认删除该会员吗?")) {
			$.getJSON("DeleServlet","id="+id,function(data){
				if (data.result>0) {
					alert("删除成功!");
					location.href="ListServlet";
				}else{
					alert("删除失败!");
				}
			});
		}
	}
</script>
</head>
<body>
<c:if test="${result>0 }"><p>更新会员信息成功</p></c:if>
<table border="1">
<tr><th colspan="7">俱乐部会员信息</th></tr>
<tr>
	<th>编号</th>
	<th>姓名</th>
	<th>性别</th>
	<th>年龄</th>
	<th>家庭住址</th>
	<th>Email</th>
	<th>操作</th>
</tr>
<c:forEach var="list" items="${list }">
<tr>
<td><a href="findById?id=${list.id }">${list.id }</a></td>
<td>${list.mname }</td>
<td>${list.mgender }</td>
<td>${list.mage }</td>
<td>${list.maddress }</td>
<td>${list.memail }</td>
<td><a href="javascript:dele(${list.id })">删除</a></td>
</tr>
</c:forEach>
</table>
</body>
</html>